function pmDevices_CreateFcn(h, e)
%PMADAPTORS_CREATEFCN Summary of this function goes here
%   Detailed explanation goes here

handles= guihandles(h);

ui.PopupMenu.Style={'style', 'PopupMenu', 'BackgroundColor', [1 1 1], 'units', 'normalized'};
SelectedAdaptor= uicontrol_SelectedItem(handles.pmAdaptors);
set(h, ...
    'string', AvailableDevices(SelectedAdaptor), ...
    'tag', 'pmDevices')
set(h, ui.PopupMenu.Style{:})

mainfig = findobj('tag', 'dhaqtool');
IniFile= getappdata(mainfig, 'IniFile');

DeviceID= inifile(IniFile,'read',{'VideoInput','','DeviceID'});
if isempty(DeviceID{1})
    uicontrol_SelectedIndex(h, 1)
else
    uicontrol_SelectedIndex(h, str2num(DeviceID{1})) %#ok<*ST2NM>
end

end

function list= AvailableDevices(Adaptor)
    imaqhw=imaqhwinfo(Adaptor);
    list={imaqhw.DeviceInfo(1:end).DeviceName};
end

